package com.yunxin.admin.system.application.command;

import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * 用户分页查询对象
 *
 * @author zero°
 * @since 2023-05-22
 */
@EqualsAndHashCode(callSuper = true)
@Schema(description = "用户分页查询对象")
@Data
public class UserPageCommand extends BasePageCommand {

    @Schema(description = "关键字(用户名/昵称/手机号)")
    private String keywords;

    @Schema(description = "用户状态")
    private Integer status;

    @Schema(description = "部门ID")
    private Long deptId;

    @Schema(description = "团队id")
    private Long teamId;

    @Schema(description = "角色ID")
    private Long roleId;

    @Schema(description = "角色Code")
    private String roleCode;

    @Schema(description = "团队id集合",hidden = true)
    private List<Long> teamIdList;

    @Schema(description = "商户id,只有超级管理员可以选择")
    public Long merchantId;

    public void setTeamId(Long teamId) {
        this.teamId = teamId;
        List<Long> teamIdList=new ArrayList<>();
        teamIdList.add(teamId);
        this.teamIdList=teamIdList;
    }
}
